package com.yz.group1.group_1.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yz.group1.group_1.entity.MedicalRecord;
import com.yz.group1.group_1.mapper.MedicalRecordMapper;
import com.yz.group1.group_1.service.MedicalRecordService;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class MedicalRecordServiceImpl extends ServiceImpl<MedicalRecordMapper, MedicalRecord> implements MedicalRecordService {

    @Override
    public List<MedicalRecord> listByRegistrationId(Long registrationId) {
        QueryWrapper<MedicalRecord> wrapper = new QueryWrapper<>();
        if (registrationId != null) {
            wrapper.eq("registration_id", registrationId);
        }
        return list(wrapper);
    }
}